core: Store "pending" objects explicitly, fix pull to use them
authorColin Walters <walters@verbum.org>
Thu, 23 Feb 2012 23:19:00 +0000 (18:19 -0500)
committerColin Walters <walters@verbum.org>
Thu, 23 Feb 2012 23:19:00 +0000 (18:19 -0500)
commitb2ad353b42620cc4bbda18fada7d0467fb0e737a
treec095b1bae34420e37342a5910c277103025bba36
parent802959f398bfc0c7acac9252e7a8f1a021884ce8
core: Store "pending" objects explicitly, fix pull to use them

Before we were creating randomly-named temporary files in repo/tmp
when downloading via pull, but that means if the download process is
interrupted, we have to redownload everything again.

Let's still keep the concept of a "transaction" where files are
stored in the repository as atomically as possible (i.e. we
do a bunch of rename() calls), but now we also have an explicit
"tmp/pending/objects" directory that contains named objects.

This allows us to then skip redownloading things that are pending.
src/libostree/ostree-repo.c
src/libostree/ostree-repo.h
src/ostree/ostree-pull.c